execute_process(
    COMMAND find . ${ROOT_AT32F403A_407_Firmware_Library}/project/at_start_f403a/examples -name "*.uvprojx"
    OUTPUT_VARIABLE ff
)

string(REPLACE ${ROOT_AT32F403A_407_Firmware_Library}/ "" ff ${ff})
string(REGEX REPLACE "/mdk_v5/[a-zA-Z0-9_]*\.uvprojx" "" ff ${ff})

# string(REPLACE "\n" ";" lst ${ff})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/projects/at_start_f403a.examples.template.cmake.in)
    message("ssssss")
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/projects/at_start_f403a.examples.template.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/123.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/projects/at_start_f403a.examples.template.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/22222222.cmake @ONLY)

foreach(x IN LISTS ff)
    string(REPLACE "/" "." x ${x})
    string(REGEX REPLACE "[a-zA-Z0-9_]+\." "" TARGET ${x})
    string(STRIP ${x} x)

    message(${x})

    # list(JOIN ${TARGET} "" TARGET)
    # message(${TARGET})
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/projects/at_start_f403a.examples.template.cmake.in "${x}" ESCAPE_QUOTES COPYONLY @ONLY)
endforeach()
